package sitar;

import oboe.controllers.Server;
import oboe.core.Oboe;
import php.Session;
import sitar.controllers.Database;
import sitar.controllers.Wall;

import php.Lib;

import sitar.controllers.User;

/**
 * ...
 * @author Felipe Manga
 */

class Main extends Server
{
	public static var db:Database;
	
	public function new() 
	{
		super();
	}
	
	@slot function onNonRemotingRequest():Void
	{
		Lib.printFile("templates/index.html");
	}
	
	@slot function onRemotingRequest():Void
	{
		this.addChild( db = new Database( { user:"sitar", pass:"sitar", host:"localhost", database:"sitar", socket:null, port:3306 } ) );
		this.addChild( new User() );
		this.addChild( new Wall() );
	}

	static function main() 
	{
		Oboe.initOboe(
			{
			},
			Main
		);
	}

}